package com.metahandler;

import com.auth.UserHolder;
import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import com.baomidou.mybatisplus.extension.plugins.inner.InnerInterceptor;
import com.dto.UserDto;
import org.apache.ibatis.reflection.MetaObject;

public class CreateUserMetaObjectHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        final UserDto userDto = UserHolder.get();
        metaObject.setValue("create_user_id", (long) userDto.getId());
    }

    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
